#include "kernel.h"

unsigned int packet_len;
unsigned int ip_checksum_loc;
unsigned int ip_len;
unsigned int ip_checksum;

void IP(unsigned char *packet, unsigned int * len) {
	packet_len = 0;
	pack_1_byte(packet, IP_VER);
	pack_1_byte(packet, DSFIELD_ICMP);
	pack_2_bytes(packet, 0x0);
	pack_2_bytes(packet, DUMMY_IDENTIFICATION);

	pack_2_bytes(packet, JOIN((FLAGS << 5), 0x0) );
	pack_1_byte(packet, 0xff);
	pack_1_byte(packet, 0x1);
	ip_checksum_loc = packet_len;
	pack_2_bytes(packet, 0x0);
	pack_4_bytes(packet, 0x0a00020f);
	pack_4_bytes(packet, 0x0a00020f);

	*len = packet_len;
	ip_len = packet_len;
}
